<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  <meta name="renderer" content="webkit">
  <title></title>
  <link rel="stylesheet" href="/Public/Admin/css/pintuer.css">
  <link rel="stylesheet" href="/Public/Admin/css/admin.css">
  <script src="/Public/Admin/js/jquery.js"></script>
  <script src="/Public/Admin/js/pintuer.js"></script>
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head"><strong class="icon-reorder"> 成绩管理</strong> </div>
  <div class="padding border-bottom">

    <ul class="search" style="padding-left:10px;">
      <form action="/Admin/Student/index" method="get">
        <ul class="search" style="padding-left:10px;">
          <li>
            <input type="text" placeholder="请输入搜索关键字" name="keywords" class="input" style="width:250px; line-height:17px;display:inline-block" value="{$keywords}" />
          </li>
          <li><input type="submit" class="button border-main icon-search" value="搜索"></li>
          <li>
            <button type="button" class="button border-yellow" onclick="window.location.href='/Admin/Student/addStudent'"><span class="icon-plus-square-o"></span> 添加学生</button>
          </li>
        </ul>
      </form>

    </ul>

  </div>
  <table class="table table-hover text-center">
    <tr>
      <th width="100" style=" padding-left:20px;">学号</th>
      <th>姓名</th>
      <th>课程名</th>
      <th>课程性质</th>
      <th>学分</th>
      <th>成绩</th>
      <th>操作</th>
    </tr>
    <?php $num = $pages['page']+1; ?>
    <volist name="lists" id="vo">
      <tr>
        <td style=" padding-left:20px;">{$vo.student_id}</td>
        <td>{$vo.userName}</td>
        <td>{$vo.couName}</td>
        <td><if condition="$vo['type'] eq 1">必修课<else/>选修课</if></td>
        <td>{$vo.coucredit}</td>
        <td>{$vo.credit}</td>
        <td>
          <div class="button-group">
            <a class="button border-main" href="/Admin/Elective/addCredit/id/{$vo.id}"><span class="icon-edit"></span>录入成绩</a>
          </div>
        </td>
      </tr>
    </volist>
    <tr>
      <td colspan="12">
        <if condition="$lists eq null">
          暂无信息
          <else/>
          <div class="pagelist">
            <a href="/Admin/Product/index/cate_id/{$cate_id}/page/0">首页</a>
            <a href="/Admin/Product/index/cate_id/{$cate_id}/page/{$pages['page']-1}">上一页</a>
            <foreach name="pages.num" item="p">
              <if condition="$p-1 eq $pages['page']">
                <span class="current">{$p}</span>
                <else/>
                <a href="/Admin/Product/index/cate_id/{$cate_id}/page/{$p-1}">{$p}</a>
              </if>
            </foreach>
            <a href="/Admin/Product/index/cate_id/{$cate_id}/page/{$pages['page']+1}">下一页</a>
            <a href="/Admin/Product/index/cate_id/{$cate_id}/page/{$pages['total']}">尾页</a>
          </div>
        </if>
      </td>
    </tr>
  </table>
</div>
<script type="text/javascript">

  $("body").bind("keydown",function(event){
    if (event.keyCode == 116) {
      event.preventDefault(); //阻止默认刷新
      //location.reload();
      //采用location.reload()在火狐下可能会有问题，火狐会保留上一次链接
      location=location;
    }
  })


  //单个删除
  function del(id){
    if(confirm("您确定要删除吗?")){
      $.ajax({
        url:"/Admin/Index/delData",
        type:"get",
        data:{
          'id':id,
          'table':'student'
        },
        success:function(data){
          if(data){
            alert("删除成功");
            location.reload();
          }
          else alert("删除失败");
        }
      })
    }
  }


</script>
</body>
</html>